/** @author Chris Howson & Steve Horsman */
/**Redundant Class*/
class Test
{
    public static void main(String args[])
    {
        Test program = new Test();
        program.testarray();
        program.testlist();
    }
    
    void testarray()
    {
        //Create a 3x3 Matrix
        Matrix s = new MatrixArray();
        //Insert 4 into 1 1
        //s.setCell(1,1,4);
        //Test setCell works by getting it and comparing 4 and the value
        //This test is also testing that getCell also works
        //if(s.getCell(1,1) != 4.0) { System.out.println("setCell: Test Failed"); }
        //Test deleteCell function
        //s.deleteCell(1,1);
        //Should have deleted value 4.0 so returns 0
        //if(s.getCell(1,1) != 0.0) { System.out.println("deleteCell: Test Failed"); }
        //Add more tests after future development
        //Matrix a = null;
        //a = s.load_Matrix("./files/input_array.txt");
        //Matrix c = a.transpose(a);
        
        Matrix m1 = s.load_Matrix("./test_files/mul1.txt");
        Matrix m2 = s.load_Matrix("./test_files/mul2.txt");
        Matrix ms = s.load_Matrix("./test_files/muls.txt");      
        Matrix m3 = m1.multiply(m2);
        
        if(!m3.compare_matrices(ms)){System.out.println("Multiplication Test failed"); }
        else { System.out.println("Success Multiplication now works!");}
        m3.print();
            
        Matrix d1 = s.load_Matrix("./test_files/det.txt");
        double det = d1.determinant();
        if(det != -418) { System.out.println("Test failed, det given: "+ det); }
        else { System.out.println("Success det now works!");}
        
        Matrix d2 = s.load_Matrix("./test_files/det2.txt");
        double det2 = d2.determinant();
        if(det2 != 18) { System.out.println("Test failed, det given: "+ det2); }
        else { System.out.println("Success det now works!");}
        
        
        Matrix inv = s.load_Matrix("./test_files/inv1.txt");
        Matrix invs = s.load_Matrix("./test_files/invs.txt");
        Matrix invs1 = inv.inverse();
        //invs1.print();
        if(!invs.compare_matrices(invs1)){System.out.println("Inverse Test failed"); }
        else { System.out.println("Success Inverse now works!");}
    }
    void testlist()
    {
        //Create a 3x3 Matrix
        //Matrix s = new MatrixList(3, 3);
        //Insert 4 into 1 1
        //s.setCell(1,1,4);
        //Test setCell works by getting it and comparing 4 and the value
        //This test is also testing that getCell also works
        //if(s.getCell(1,1) != 4.0) { System.out.println("setCell: Test Failed"); }
        //Test deleteCell function
        //s.deleteCell(1,1);
        //Should have deleted value 4.0 so returns 0
        //if(s.getCell(1,1) != 0.0) { System.out.println("deleteCell: Test Failed"); }
        //Add more tests after future development
        //Matrix a = null;
        //a = s.load_Matrix("./files/input_list.txt");
        //Matrix c = a.transpose(a);
    }
}
